<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page
	import="com.grep.web.IndexService,java.util.*,com.grep.extra.factory.data.impl.SiteUrl"%>
<%@ include file="../common/taglibs.jsp"%>
<%@ include file="../common/ckeckuser.jsp" %>
<%
	request.setCharacterEncoding("UTF-8");
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	IndexService indexService = new IndexService();
	List<SiteUrl> allSites = indexService.getAllSites();

	request.setAttribute("allSites", allSites);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>任务管理</title>
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../js/common.js" type="text/javascript"></script>
<script src="../js/taskmanager.js" type="text/javascript"></script>
<link href="${base }/style/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../common/manager_menu.jsp"%>
	<div id="sider_right">
		<img src="${base }/images/rightbordertop.jpg" class="imgfloat" />
		<div id="sr_cont" class="siderborder">
			<img src="${base }/images/neing.jpg" class="imgfloat" width="724" />
			<div id="newzd">
				<div class="tabcontainer">
					<form method="post" style="margin-bottom:10px;">
						<span style="float: left; margin-right: 25px;"> <select
							id="selectwebsite">
								<option value="null" >请先选择站点</option>
								<c:forEach var="site" items="${allSites}" varStatus="status">
									<option value="${site.id}">${site.siteName}</option>
								</c:forEach>
						</select>
						</span> 
						 
						<span class="looknew" id="newtask">
							<a href="javascript:void(0)" onclick="displayaddtask()">新建任务</a>
						</span>

					</form>
					<div id="displaytable">
						<span id="nonedata">暂无数据，可首先选择站点，然后点击新建任务</span>
						<div id="displaytaskdata"style="width:700px; padding:0;float:left;display:none">	
						</div>
						<div class="tabcontainer" id="fenye" style="display:none">              
                       		<span id="shouye"class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="shouye()">首页</a></span>                       		
                       		<span id="prevpage" class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="prevpage()">上一页</a></span>                     	
                       		<ul id="fenyenum"></ul>	
			                <span id="nextpage" class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="nextpage()">下一页</a></span>
			                <span id="lastpage" class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="lastpage()">末页</a></span>			                
	                    	<span id="dangqian_count" class="sfpn"></span>				                    		                  		
			            </div> 
					</div>
				</div>
			</div>
			<div id="displaynewtask" class="ajaxdisplay">
				<form method="post">
					<span id="newzd_tit">
						<samp id="newzdxuan">新建采集任务</samp>
					</span> 
					<span id="csdz"> 
						<label for="taskname">任务名称:</label>
						<input type="text" onkeyup="isnull('taskname')" id="taskname" class="cjinput" name="taskname" />
						<span id="taskname_0" class="inputtishi">任务名称不能为空</span>
					</span> 
					<span id="csdz"> 
						<label for="taskdesc">任务描述:</label>
						<input type="text" onkeyup="isnull('taskdesc')" id="taskdesc" class="cjinput" name="taskdesc" />
						<span id="taskdesc_0" class="inputtishi">任务描述不能为空</span>
					</span> 
					<span id="csdz" style="width: 590px;"> 
						<label for="taskpolicy">执行策略(任务多久执行一次):</label> 
						<input type="text" onkeyup="isnull('taskpolicy')" id="taskpolicy" class="cjinput" name="taskpolicy" />
						<span id="taskpolicy_0" class="inputtishi">执行策略不能为空</span>
					</span>
					<span id="csdz" style="width: 590px;"> 
						<label for="taskanalyse">采集策略(指定到具体的htm):</label> 
						<input type="text" onkeyup="isnull('taskanalyse')" id="taskanalyse" class="cjinput" name="taskanalyse" />
						<span id="taskanalyse_0" class="inputtishi">采集策略不能为空</span>						
					</span> 
					<input type="button" value="完成" onclick="addtask()" id="next" 	style="display: inline;" />
				</form>	
				<div>
					<a class="p_h_x" onclick="hideDiv('displaynewtask')" title="关闭窗口">X</a>
				</div>			
			</div>
			<div id="displaymodifictask" class="ajaxdisplay">
					<form  method="post">
						<span id="newzd_tit">
							<samp id="newzdxuan">修改采集任务</samp>
						</span> 
						<span id="csdz"> 
							<label for="modific_taskname">任务名称</label>
							<input type="text" onkeyup="isnull('modific_taskname')" id="modific_taskname" class="cjinput" name="modific_taskname" value="" />
							<input type="hidden" id="modific_taskid" name="modific_taskid" value="" />
							<span id="modific_taskname_0" class="inputtishi">任务名称不能为空</span>
						</span> 
						<span id="csdz">
							<label for="modific_taskdesc">任务描述</label>
							<input type="text" onkeyup="isnull('modific_taskdesc')" id="modific_taskdesc" class="cjinput" name="modific_taskdesc" value="" />
							<span id="modific_taskdesc_0" class="inputtishi">任务描述不能为空</span>
						</span>
						<span id="csdz" style="width: 590px;"> 
							<label for="modific_taskpolicy">执行策略(任务多久执行一次):</label>
							<input type="text" onkeyup="isnull('modific_taskpolicy')" id="modific_taskpolicy" class="cjinput" name="modific_taskpolicy" value="" />
							<span id="modific_taskpolicy_0" class="inputtishi">执行策略不能为空</span>
						</span> 
						<span id="csdz" style="width: 590px;">
							<label for="modific_taskanalyse">采集策略(指定到具体的htm):</label>
							<input type="text" onkeyup="isnull('modific_taskanalyse')" id="modific_taskanalyse" class="cjinput" name="modific_taskanalyse"	value="" />
							<span id="modific_taskanalyse_0" class="inputtishi">采集策略不能为空</span>							
						</span> 
						<input type="button" value="修改" id="next" onclick="modifictask()"  style="display: inline;" />
					</form>
					<div>
						<a class="p_h_x" onclick="hideDiv('displaymodifictask')" title="关闭窗口">X</a>
					</div>
				</div>
		</div>
	<img src="${base }/images/rightborderbuttom.jpg" class="imgfloat" />
	</div>
</body>
</html>